<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let preURL=document.referrer;//获取上一个页面的URL,不是超链接
        if(preURL==""){
            document.write("<h1>非法访问，跳转到主页面<h1>")
                setTimeout("location.href='ex7-'",3000)
        }else{
            document.write("<h1>得奖<h1>")
        }

    </script>
</head>
<body>
    
</body>
</html>